package org.springframework.ui;

public interface Model {
	fun addAttribute(attributeName: String, attributeValue: Any): Model
	fun addAllAttributes(attributes: Map<String, Any>): Model
	fun asMap(): Map<String, Any>

}


class RedirectAttributesModelMap : Model {

	var map = hashMapOf<String, Any>()


	override fun addAttribute(attributeName: String, attributeValue: Any): Model {
		map.put(attributeName, attributeValue)
		return this
	}

	override fun addAllAttributes(attributes: Map<String, Any>): Model {
		map.putAll(attributes)
		return this
	}

	override fun asMap(): Map<String, Any> = map

}